package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
)

func main() {
	path := "./demo.txt"
	file, _ := os.Open(path)
	reader := bufio.NewReader(file)

	for {
		buf, err := reader.ReadBytes('\n')
		if err != nil {
			if err == io.EOF {
				break
			}
			fmt.Println("err: ", err)
		}
		fmt.Println(string(buf))
	}

}
